<template>
  <div class="app-container">
    <RDBMSReader v-show="dataSourceType!=='hive' && dataSourceType!=='hbase' && dataSourceType!=='mongodb'" ref="rdbmsreader" @select-data-source="showDataSource" />
  </div>
</template>

<script>
import RDBMSReader from './reader/RDBMSReader.vue'
export default {
  name: 'Reader',
  components: { RDBMSReader },
  data() {
    return {
      dataSourceType: ''
    }
  },
  methods: {
    getData() {
      if (this.dataSourceType === 'mongodb') {
      } else {
        return this.$refs.rdbmsreader.getData()
      }
    },
    showDataSource(data) {
      this.dataSourceType = data
      this.getData()
    },
    resetForm() {
       if (this.dataSourceType === 'mongodb') {
      } else {
        return this.$refs.rdbmsreader.resetForm()
      }
    }
  }
}
</script>
